/* 
 * See liquidator.css
 * 
 * Liquidator will transform simple and logical html into the structure that 
 * has "fixed left/liquid right" behavior 
 * 
 * Input: 
 * 
 * <div class='liquidator'>
 *     <div class='left'></div>
 *     <div class='right'></div>
 * </div>
 * 
 * Output:
 * <div class='liquidator'>
 *     <div class='wrapright'>
 *         <div class='right'></div>
 *     </div>
 *     <div class='left'></div>
 * </div>
 */

$.fn.addLiquid = function() {
    var fullHeight = "";
    if($(this).hasClass("full-height")){
        fullHeight = "full-height";
    }
    var w = 100;
    if ($(this).data("fixed-width")) {
        w = $(this).data("fixed-width");
    }
    var left = $(this).find(".left").first();
    var right = $(this).find(".right").first();
    var wrapright = $("<div class='wrapright'></div>");
    left.before(wrapright);
    right.detach().appendTo(wrapright);
    left.css("width", w + "px");
    right.css("margin-left", w + "px");
    left.addClass(fullHeight);
    right.addClass(fullHeight);
    wrapright.addClass(fullHeight);
};



